{extend name="default2/base" /}
{block name="title"}我的购物车 - {:WSTConf('CONF.mallName')}{__block__}{/block}
{block name="css"}
<link href="__STYLE__/css/carts.css?v={$v}" rel="stylesheet">
{/block}
{block name="main"}
<div class="wst-container">
	<div id="stepflex" class="stepflex">
       <dl class="first doing">
          <dt class="s-num">1</dt>
          <dd class="s-text">我的购物车</dd>
          <dd></dd>
       </dl>
       <dl class="normal">
          <dt class="s-num1">2</dt>
          <dd class="s-text1">填写核对订单信息</dd>
       </dl>
       <dl class="last">
          <dt class="s-num1">3</dt>
          <dd class="s-text1">成功提交订单</dd>
       </dl>
    </div>
    <div class='wst-clear'></div>
    <div class='main-head'>我的购物车</div>
    <div class='cart-box'>
       <div class='cart-head'>
          <div class='chk'><input type='checkbox' onclick='checkChks(this,".j-chk")'>全选</div>
          <div class='goods'>商品</div>
          <div class='price'>单价</div>
          <div class='stock'>库存</div>
          <div class='num'>数量</div>
          <div class='t-price'>总价</div>
          <div class='action'>操作</div>
       </div>
       {if !empty($carts["carts"])}
	       {volist name='$carts["carts"]' id='vo'}
	       <div class='cart-item'>
	          <div class='shop'>
	          <input type='checkbox' class='j-chk' onclick='checkChks(this,".j-s{$vo['shopId']}")'>{$vo['shopName']}
	          {if $vo['shopQQ'] !=''}
	          <a href="tencent://message/?uin={$vo['shopQQ']}&Site=QQ交谈&Menu=yes">
				  <img border="0" src="http://wpa.qq.com/pa?p=1:{$vo['shopQQ']}:7" alt="QQ交谈" width="71" height="24" />
			  </a>
	          {/if}
	          {if $vo['shopWangWang'] !=''}
	          <a target="_blank" href="http://www.taobao.com/webww/ww.php?ver=3&touid={$vo['shopWangWang']}&siteid=cntaobao&status=1&charset=utf-8">
				  <img border="0" src="http://amos.alicdn.com/realonline.aw?v=2&uid={$vo['shopWangWang']}&site=cntaobao&s=1&charset=utf-8" alt="和我联系" />
			  </a>
	          {/if}
	          </div>
	          <div class='goods-list'>
	             {volist name='vo["list"]' id='vo2'}
	             <div class='item j-chk {if $vo2["isCheck"]==1}selected{/if} j-s{$vo['shopId']} j-g{$vo2["cartId"]}'>
	                <div class='chk'><input id='gchk_{$vo2["cartId"]}' type='checkbox' {if $vo2["isCheck"]==1}checked{/if} mval="{$vo2['shopPrice']}" value="{$vo2['cartId']}" sval="{$vo2['goodsStock']}" allowbuy="{$vo2['allowBuy']}" class='j-chk j-s{$vo['shopId']} j-gchk' onclick='checkChks(this,".j-g{$vo2["cartId"]}")'></div>
			        <div class='goods'>
			            <div class='img'>
				            <a href='{:Url("home/goods/detail","id=".$vo2["goodsId"])}' target='_blank'>
				            <img src='__ROOT__/{$vo2["goodsImg"]}' width='80' height='80' title='{$vo2["goodsName"]}'/>
				            </a>
			            </div>
			            <div class='name'>{$vo2["goodsName"]}</div>
			            <div class='spec'>
			            {volist name='vo2["specNames"]' id='specs'}
			            <div>{$specs['catName']}：{$specs['itemName']}</div>
			            {/volist}
			            </div>
			        </div>
			        <div class='price'>¥{$vo2['shopPrice']}</div>
			        <div class='stock'>{$vo2['goodsStock']}</div>
			        <div class='num'>
				        <a href='#none' class='buy-btn' id='buy-reduce_{$vo2['cartId']}' onclick='javascript:WST.changeIptNum(-1,"#buyNum","#buy-reduce,#buy-add",{$vo2['cartId']},"statCartMoney")'>-</a>
			            <input type='text' id='buyNum_{$vo2['cartId']}' class='buy-num' value="{$vo2['cartNum']}" data-max="{$vo2['goodsStock']}" data-min='1' onkeyup='WST.changeIptNum(0,"#buyNum","#buy-reduce,#buy-add",{$vo2['cartId']},"statCartMoney")' autocomplete="off"  onkeypress="return WST.isNumberKey(event);" maxlength="6"/>
			            <a href='#none' class='buy-btn' id='buy-add_{$vo2['cartId']}' onclick='javascript:WST.changeIptNum(1,"#buyNum","#buy-reduce,#buy-add",{$vo2['cartId']},"statCartMoney")'>+</a>
			            <div id='err_{$vo2['cartId']}' class='wst-clear'></div>
			        </div>
			        <div class='t-price'>¥<span id="tprice_{$vo2['cartId']}">{$vo2['shopPrice']*$vo2['cartNum']}</span></div>
			        <div class='action'><a href='javascript:WST.delCart({$vo2["cartId"]})'>删除</a></div>
			        <div class='wst-clear'></div>
	             </div>
	             {/volist}
	          </div>
	       </div>
	       {/volist}
	       <div class='cart-footer selected2'>
	          <div class='cart-summary'>
	             <div class='summary'>应付总金额(不含运费)：¥<span id='totalMoney'>{$carts["goodsTotalMoney"]}</span></div>
	             <div class='wst-clear'></div>
	          </div>
	       </div>
	       	  <div class='cart-btn'>
	             <a href='__ROOT__/index.php' class='wst-contnue wst-cart-asha'>继续购物</a>
	             <a href='#none' onclick='toSettlement()' class='wst-next wst-cart-reda'>结算</a>
	             <div class='wst-clear'></div>
	          </div>
       {else}
       <div class='empty-cart'>
                             您还没有添加商品哦，快去<a href='{:Url("home/index/index")}'>逛逛</a>吧~
       </div>
       {/if}
    </div>
</div>
{/block}
{block name="js"}
<script type='text/javascript' src='__STYLE__/js/carts.js?v={$v}'></script>
{/block}